the domain has gone away, then no-one can attach to the pty because Xend will
have cleaned up the entries in the store, so the pty will never become ready to
write. The buffer will never get emptied, so cleanup will never occur. This
leaks ptys, file descriptors, and memory. Simply throw those data away instead.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
static void cleanup_domain(struct domain *d)
{
- if (!buffer_empty(&d->buffer))
- return;
-
if (d->tty_fd != -1) {
close(d->tty_fd);
d->tty_fd = -1;